/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Abril_4.Ej_15_04_13_01;

import java.io.File;
import java.util.Scanner;

/**
 *
 * @author vesprada
 */
public class nPalabras {

    public static void main(String[] args) {
        File archivo = new File("lineas.txt");
        try {
            Scanner lector = new Scanner(archivo);
            int L = 0;
            while (lector.hasNext()) {
                lector.nextLine();
                L++;
            }
            int P=0;
            Scanner lector2 = new Scanner(archivo);
            while (lector2.hasNext()) {
                lector2.next();
                P++;
            }
            System.out.println("Palabras:"+P);
            System.out.println("Lineas:"+L);

        } catch (Exception e) {
        }

    }
}
